package mjc.tds;

import java.util.Collection;
import java.util.Set;
import mjc.gc.AbstractMachine;

public class TDV extends TDS<String,Info_Variable> {

	protected int deplacement_courant_bloc;
	protected int deplacement_courant_param;
	protected int taille_bloc;
	protected int taille_param;
	
	public TDV () {
		super() ;
		this.taille_bloc = 0;
		this.taille_param = 0;
		this.deplacement_courant_bloc = 3;
		this.deplacement_courant_param = -AbstractMachine.CLASS_SIZE;
	}

	public TDV (TDV parente) {
		super(parente) ;
		this.taille_bloc = 0;
		this.taille_param = 0;
		this.deplacement_courant_bloc = 3;
		this.deplacement_courant_param = -AbstractMachine.CLASS_SIZE;
	}
	
	public void ajouter(String cle, Info_Variable infos){
		ajouterVariable(cle, infos);
	}
	
	public void ajouterVariable(String cle, Info_Variable infos){
		super.ajouter(cle, infos);
		this.taille_bloc += infos.getType().getTaille();
	}
	
	public void ajouterParametre(String cle, Info_Variable infos){
		super.ajouter(cle, infos);
		this.taille_param += infos.getType().getTaille();
	}
	
	public int getTailleBloc(){
		return this.taille_bloc;
	}
	
	public int getTailleParam(){
		return this.taille_param;
	}
	
	public int getDeplacementBloc(){
		return deplacement_courant_bloc;
	}
	
	public int getDeplacementParam(){
		return deplacement_courant_param;
	}
	
	public void decrementeDeplacementParam(int decrement){
		this.deplacement_courant_param -= decrement;
	}
	
	public void incrementeDeplacementBloc(int increment){
		this.deplacement_courant_bloc += increment;
	}
	
}
